/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.digwener.entities.users;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlAttribute;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "userType", propOrder = {
     "responsibility"
})
//@XmlTransient - ignore the field
public class UserType {
    protected List<ResponsibilityType> responsibility;
    
    @XmlAttribute
    protected String name;
    
    public List<ResponsibilityType> getResponsibilities() {
        if (responsibility == null) {
            responsibility = new ArrayList<ResponsibilityType>();
        }
        return this.responsibility;
    }
    
    public void setResponsibilites(List<ResponsibilityType> responsibility ){
        this.responsibility = responsibility;
    }

    public List<ResponsibilityType> getResponsibility() {
        return responsibility;
    }

    public void setResponsibility(List<ResponsibilityType> responsibility) {
        this.responsibility = responsibility;
    }

    
    public String getName() {
        return name;
    }

    public void setName(String userName) {
        this.name = userName;
    }
    
//    public void merge(List<ResponsibilityType> resps){
//        if (this.responsibility == null) {
//            this.responsibility = new ArrayList<ResponsibilityType>();
//        }
//        for(ResponsibilityType r:resps){
//            if(!this.responsibility.contains(r)){
//                this.responsibility.add(r);
//            }
//        }
//    }
    
    
    

}
